{php}
{//var_dump($vo);}
{//var_dump($plsend);}
{/php}
<!-- plsend 批量发送 -->
<style type="text/css">
  .xj_price{display: none;}
  .gprice_type{display: none;}
</style>
<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body">
        {if $plsend==false}
         <div class="layui-form-item">
                    <label class="layui-form-label label-required">公司名称</label>
                 <div class="layui-input-block">
                    
              <input name="name" value='{$vo.name}' disabled="disabled" placeholder="{$vo.name}" class="layui-input">
          </div>
         </div>
        {/if}
<!--                   <div class="layui-form-item">
                    <label class="layui-form-label label-required">负责人</label>
                 <div class="layui-input-block">
              <input name="name" value='{$vo.name}' disabled="disabled" placeholder="{$vo.name}" class="layui-input">
          </div>
         </div> -->

        <div class="layui-form-item">
            <label class="layui-form-label label-required">微信消息类型</label>
        <div class="layui-input-block">
            <select  id="wxtpl_type" class="layui-select" name="wxtpl" lay-filter="wxtpl_type" >
            <option value="">-- 选择发送微信消息模板 --</option>
            <option value="1">缴费通知</option>
            <option value="2">通用消息</option>
            </select>
            </div>
             </div>

<!--             <div class="layui-form-item xj_price" id="xj_price">
            <label class="layui-form-label label-required">缴费规格</label>
        <div class="layui-input-block">
           <select  id="commodity_list" class="layui-select" name="commodity_list" lay-filter="commodity_list" >
            <option value="">-- 选择缴费规格 --</option>

                    {foreach $commodity_list as $key=>$val}

                         
                        <option data-price="{$val.money}" value="{$val.id}">

                        {if condition="($val.year neq 0)"}
                            {$val.year|default=''}/年付
                        {elseif condition="($val.month neq 0)"/}
                            {$val.month|default=''}/月付
                        {elseif condition="($val.day neq 0)"/}
                           {$val.day|default=''}/日付
                        {else /}
                        {/if}
                        -      
                        {if condition="($val.outAppnumber neq 0)"}
                        限制接待人数:
                        {$val.outAppnumber|default=''}人
                        {/if}
                        {if condition="($val.outnumber neq 0)"}
                        限制公司人数:
                        $val.outnumber|default=''}人
                        {/if}
                    </option>

                        {/if}
                    {/foreach}
            </select>

            
            </div>
             </div> -->


        <!-- 缴费类型 -->
        <div class="layui-form-item gprice_type">
            <label class="layui-form-label label-required">缴费类型</label>
        <div class="layui-input-block">
            <select  id="gprice_type" class="layui-select" name="gprice_type" lay-filter="gprice_type" >
            <option value="">-- 选择缴费类型 --</option>
            <option value="1">系统费用</option>
            <option value="2">统一费用(租金、水、电、物业)</option>
            <option value="3">租金费用</option>
            <option value="4">水费</option>
            <option value="5">电费</option>
            </select>
            </div>
             </div>

            <div class="layui-form-item xj_price" id="xj_price">
            <label class="layui-form-label label-required">缴费金额</label>
        <div class="layui-input-block">
             <input required style="width:130px" class="layui-input inline-block text-center padding-left-0" name="price" data-blur-number="2" value="0.01"> 
            </div>
             </div>


        <div class="layui-form-item">
            <label class="layui-form-label label-required">消息内容</label>
            <div class="layui-input-block">
                <input name="wxmessag" value='' required placeholder="请输入消息内容" class="layui-input">
            </div>
        </div>



    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}
    {if $plsend}
        <input type="hidden" value='{$plsend_id}' name='id'>
    {else}
        <input type="hidden" value='{$vo.id}' name='id'>
    {/if}

    {/notempty}

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>发送消息</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>

<script type="text/javascript">
  layui.use(['element','form'], function(){
    var element = layui.element;
    var form = layui.form;
    var  layer = layui.layer;
 
 form.on('select(wxtpl_type)', function (data) {
         var message=$("select[name=wxtpl").val();
         var block_allcss ={'display':'block'}
         var none_allcss = {'display':'none'}
         if(message ==1){

            $('.xj_price').css(block_allcss)
            $('.gprice_type').css(block_allcss)
         }else{
             $('.xj_price').css(none_allcss)
             $('.gprice_type').css(none_allcss)
         }

      });


 form.on('select(commodity_list)', function (data) {
         var iteValue = $("select[name=commodity_list").find("option:selected").data("price");
         if(iteValue){
            $("input[name='price']").val(iteValue)
         }else{
            $("input[name='price']").val(0.01)
         }

      });

});
</script>
    <script>

    window.form.render();

</script>



</form>


